package com.itany.mall.service;

import java.util.List;

import com.itany.mall.entity.Product;
import com.itany.mall.exception.ProductNameExistsException;
import com.itany.mall.exception.ProductNotFoundException;
import com.itany.mall.exception.ProductTypeNotFoundException;
import com.itany.mall.exception.ServiceException;
import com.itany.mall.vo.PageInfo;

public interface ProductService {

	List<Product> findAll() throws ServiceException;

	void addProduct(String name, double price, long typeId)
			throws ProductNameExistsException, ProductTypeNotFoundException, ServiceException;

	Product findById(long productId) throws ProductNotFoundException, ServiceException;

	/**
	 * 分页查询所有商品
	 * @param pageNo 当前页码
	 * @param pageSize 每页显示条数
	 * @return 分页对象
	 * @throws ServiceException 
	 */
	PageInfo<Product> findAll(int pageNo, int pageSize) throws ServiceException;

}
